package org.rambadger.command.command;

import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.NotNull;

/**
 * {@link org.rambadger.command.command Command} class for creating new {@link org.rambadger.command.model.AssignmentEntity Assignments}.
 */
public class CreateTrack {
    @TargetAggregateIdentifier
    private final String platformId;
    private final String trackId;
    private final String trackName;
    private final String description;

    /**
     * Instantiates a new Create Track command.
     *
     * @param platformId the URL comptaible id of the platform the track is being added to.
     * @param trackId the URL compatible identifer for the track (unique per platform)
     * @param trackName Longer display name, used as a title.
     * @param description A longer description
     */
    public CreateTrack(String platformId, String trackId, String trackName, String description) {
        this.platformId = platformId;
        this.trackId = trackId;
        this.trackName = trackName;
        this.description = description;
    }

    /**
     * Gets the id of the platform that the track belongs to
     *
     * @return the platform id
     */
    @UrlIdentifier
    @NotNull
    public String getPlatformId() {
        return platformId;
    }

    /**
     * Gets track id.
     *
     * @return the track id
     */
    @UrlIdentifier
    @NotNull
    public String getTrackId() {
        return trackId;
    }

    /**
     * Gets the track display name.
     *
     * @return the track name
     */
    @Length(max = 64)
    @NotBlank
    public String getTrackName() {
        return trackName;
    }

    /**
     * Gets description.
     *
     * @return the description
     */
    @Length(max = 4096)
    @NotNull
    public String getDescription() {
        return description;
    }
}
